A sendfile operation is an operation commonly supported by operating systems 5 such as the Linux and UNIX operating systems, as illustrated in FIG. 1. The sendfile operation allows an application 15 to send a file to another computer 11A,B asynchronously. The operation utilizes a socket that has been established for communication between two applications 15, 13A,B or programs on the respective computers for the transfer of data in the form of a file 1. Data is transferred to a spool area on the target computer where the data can be retrieved when a destination application is ready to retrieve it.
A sendfile operation is initiated by the computer 3 sending the file. A thread 7 is assigned to each sendfile operation to manage the transfer of data. The data transferred is sent in chunks or packets. The thread 7 servicing the sendfile operation waits idly between the transmission of chunks, which may be delayed due to the source machine 3 or target machine 11 A,B being busy with other operations or suffering from a software or hardware failure. For example, in many instances a target machine stops responding to the sendfile operation due to an unexpected termination of the target machine or the severing of connectivity to the target machine 11 A,B and the connection between the machines is not properly closed. Also, many types of connections are used infrequently. Web browsers make requests for a web page and related data to display to a user. A considerable lag may be present between the target machine and source machine due to distance or network conditions. As a result, the thread 7 assigned to the sendfile spends a considerable amount of time idle, but consuming memory and processor resources thereby decreasing the productivity of the source machine.
Many types of applications 15 utilize sendfile operations. A webserver is an application that can utilize the sendfile operation. A web server can provide a range of resources including web pages, database access and multi-media resources over networks 9 including the Internet. These resources are accessed by various web client applications such as web browsers, specialized client applications and media players. The web server can service requests for some of these resources by using a sendfile operation. Large numbers of clients and their host machines can attempt to connect to a web server. This can require a web server to service a large number sendfile operations simultaneously thereby consuming considerable processing resources. Each sendfile operation is assigned to a separate working thread 7 to manage the transfer of requested files. Each thread requires memory and processing resources. This creates an upper limit on the number of threads and consequently the number of sendfile operations that a server can manage at one time based on the memory and processor resources of the server machine.